﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Samurai.Client
{
    public class ExceptionReportDataContext
    {
        public Exception Exception { get; set; }

        public string StackTrace { get; set; }

        public ExceptionReportDataContext(Exception exception)
        {
            Exception = exception;
            ExceptionDetail = "An unwanted situation occured. Please keep us informed, so that we can fix it";

            if (exception.InnerException != null)
                StackTrace = string.Format("Exception: {0}{1}Stack Trace: {2}", exception.ToString(), Environment.NewLine, exception.InnerException.StackTrace);
            else
                StackTrace = string.Format("Exception: {0}{1}Stack Trace: {2}", exception.ToString(), Environment.NewLine, exception.StackTrace);

            ReportExceptionCommand = new ReportExceptionCommand();
        }

        public string ExceptionDetail { get; set; }

        public ReportExceptionCommand ReportExceptionCommand { get; set; }

    }
}
